package hkr.vfu.bluecenter.backend;

import java.util.TimerTask;

import hkr.vfu.bluecenter.BluecenterController;
import hkr.vfu.bluecenter.swipe_fragments.BoxFragment;

/**
 * Created by mattiasbowallius on 16/01/14.
 */
public class ContinuousTimerTask extends TimerTask {

    private final BluecenterController updateUiListener;
    private final BoxFragment boxFragment;

    public ContinuousTimerTask(BluecenterController updateUIListener, BoxFragment boxFragment) {
        this.updateUiListener = updateUIListener;
        this.boxFragment = boxFragment;
    }

    @Override
    public void run() {
        boxFragment.executeCommandsFromFile(boxFragment.repetitiveContinuousFile);
        boxFragment.saveLogFile();
        updateUiListener.saveHashMap();
    }
}
